package fun.sssdnsy.model;

import javafx.beans.property.IntegerProperty;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;

public class PasswordEntry {

    private final IntegerProperty index = new SimpleIntegerProperty(0); // 新增序号属性
    private final StringProperty domain = new SimpleStringProperty("");
    private final StringProperty username = new SimpleStringProperty("");
    private final StringProperty password = new SimpleStringProperty("");
    private final StringProperty notes = new SimpleStringProperty("");

    public PasswordEntry() {}

    public PasswordEntry(int index,String domain, String username, String password, String notes) {
        setIndex(index);
        setDomain(domain);
        setUsername(username);
        setPassword(password);
        setNotes(notes);
    }

    // Getters and setters for all properties
    public int getIndex() { return index.get(); }
    public void setIndex(int value) { index.set(value); }
    public IntegerProperty indexProperty() { return index; }

    public String getDomain() { return domain.get(); }
    public void setDomain(String value) { domain.set(value); }
    public StringProperty domainProperty() { return domain; }

    public String getUsername() { return username.get(); }
    public void setUsername(String value) { username.set(value); }
    public StringProperty usernameProperty() { return username; }

    public String getPassword() { return password.get(); }
    public void setPassword(String value) { password.set(value); }
    public StringProperty passwordProperty() { return password; }

    public String getNotes() { return notes.get(); }
    public void setNotes(String value) { notes.set(value); }
    public StringProperty notesProperty() { return notes; }
}
